home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hobby PC 28
/
Hobby PC 28.iso
/
MicrografxMM
/
FlowCharter
/
Autosamp
/
NETWORK.FRM
< prev
next >
Wrap
Text File
|
1997-03-04
|
16KB
|
564 lines
VERSION 4.00
Begin VB.Form NetworkDatabaseDemo
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Network Database Demo"
ClientHeight = 1950
ClientLeft = 1245
ClientTop = 2190
ClientWidth = 5265
ClipControls = 0 'False
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 2355
Icon = "NETWORK.frx":0000
Left = 1185
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1950
ScaleWidth = 5265
Top = 1845
Width = 5385
Begin VB.CommandButton BrowseBtn
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "&Browse..."
Height = 375
Left = 3690
TabIndex = 6
Top = 795
Width = 1335
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 495
Left = 4350
Picture = "NETWORK.frx":030A
ScaleHeight = 495
ScaleWidth = 495
TabIndex = 4
Top = 195
Width = 495
End
Begin VB.Data Data1
Appearance = 0 'Flat
Caption = "Data1"
Connect = ""
DatabaseName = ""
Exclusive = 0 'False
Height = 270
Left = 1440
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Network"
Top = 3600
Visible = 0 'False
Width = 1935
End
Begin VB.CommandButton cmdCancel
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "&Cancel"
Height = 375
Left = 2640
TabIndex = 2
Top = 1440
Width = 1335
End
Begin VB.CommandButton cmdOK
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "&OK"
Default = -1 'True
Height = 375
Left = 1065
TabIndex = 1
Top = 1440
Width = 1335
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 285
Left = 105
TabIndex = 0
Top = 840
Width = 3465
End
Begin MSComDlg.CommonDialog OpenDatabaseFile
Left = 120
Top = 1440
_Version = 65536
_ExtentX = 847
_ExtentY = 847
_StockProps = 0
End
Begin AbcflowLib.ABC ABC1
Left = 4320
Top = 1440
_Version = 65536
_ExtentX = 1085
_ExtentY = 873
_StockProps = 1
End
Begin VB.Label Label2
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "Press ""Browse"" to choose another database."
ForeColor = &H80000008&
Height = 495
Left = 840
TabIndex = 5
Top = 120
Width = 3015
End
Begin VB.Label Label1
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Database File:"
ForeColor = &H80000008&
Height = 195
Left = 120
TabIndex = 3
Top = 600
Width = 1245
End
Begin VB.Line Line1
BorderColor = &H00FFFFFF&
X1 = 0
X2 = 5280
Y1 = 1320
Y2 = 1320
End
End
Attribute VB_Name = "NetworkDatabaseDemo"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Dim ABC As Object
Dim NetSource As RECORD
Dim UserName As String
Dim DataBaseFile As String
Dim TestFileValid As String
Const DATA_ERRCONTINUE = 1
Const DATA_ERRDISPLAY = 0
Const OFN_FILEMUSTEXIST = &H1000&
Const OFN_PATHMUSTEXIST = &H800&
Private Sub ABC1_AppQuitNOTIFY()
Data1.Recordset.Close
End
End Sub
Private Sub ABC1_DoubleClickSUBCLASS(ByVal Object As Object, ByVal Chart As Object, Override As Boolean)
Dim Obj As Object
Set Obj = ABC1.Chart.Objects.ItemFromText(".mdb")
If Obj.Valid Then
' Get the database from the chart
Data1.DatabaseName = Obj.Text
GetDatabaseInfo (Object.Text)
Else
End If
Override = True
End Sub
Private Sub BrowseBtn_Click()
'In case of error
On Error Resume Next
'Set properties here
OpenDatabaseFile.CancelError = True
OpenDatabaseFile.DefaultExt = "mdb"
OpenDatabaseFile.Filter = "Database Files(*.mdb)|*.mdb"
OpenDatabaseFile.Flags = OFN_FILEMUSTEXIST And OFN_PATHMUSTEXIST
OpenDatabaseFile.Action = 1
'Close if cancelled
If Err = 32755 Then
Exit Sub
Else
DataBaseFile = OpenDatabaseFile.filename
End If
Text1.Text = DataBaseFile
End Sub
Private Sub cmdCancel_Click()
Unload NetworkDatabaseDemo
End
End Sub
Private Sub cmdOK_Click()
Dim DataBaseFileOne As Integer
Dim DataBaseFileTwo As Integer
Err = 0
DataBaseFile = Text1.Text
DataBaseFileOne = InStr(DataBaseFile, "NETBASE1.MDB")
DataBaseFileTwo = InStr(DataBaseFile, "NETBASE2.MDB")
If Not DataBaseFileOne > 1 And DataBaseFileTwo = 0 Then
Err = 2
ElseIf Not DataBaseFileTwo > 1 And DataBaseFileOne = 0 Then
Err = 2
End If
If Err = 1 Then
cmdOK.Enabled = False
MsgBox "File does not exist!", 48
Text1.SetFocus
End If
If Err = 2 Then
cmdOK.Enabled = False
MsgBox "This is an Invalid Database File!", 48
Text1.SetFocus
End If
If Err = 0 Then
cmdOK.Enabled = False
NetworkDatabaseDemo.WindowState = 1 ' iconize form
NetworkDatabaseDemo.Refresh
'Build the chart
Call DrawNetChart(DataBaseFile)
Call ValidateFilename
End If
End Sub
Private Sub DrawNetChart(DataBaseFile As String)
Dim Shape As Object
Dim Shape1 As Object
Dim TextTitle As Object
Dim recCount As Integer
Dim PageWidth As Integer
Dim ChartCancelled As Integer
Dim CurrentRec As String
Dim FieldInfo As String
Dim ProcessorType As String
Dim Chart As Object
Dim ABCObject As Object
Dim NewLine() As Object
Dim Obj As Object
Dim DataBaseText As Object
Dim Counter As Integer
Dim TotalCount As Integer
'Get the chart
Set Chart = ABC.New
Rem Set the Chart's internal type
Chart.Type = "NETWORK"
Chart.TypeUsesEXE = True
Set ABCObject = Chart.Objects
'Prepare for chart to draw
Chart.NoRepaint = True
Chart.MasterItems.HideAll
Chart.PageLayout.Orientation = 1
Chart.View = 1
ABC.ShapePaletteVisible = False
' Set defaults so there are no shape numbers